Skip to content

[%pS migration] Use %pS in ext/spl/* - #23146

Merged
DanielEScherzer merged 6 commits into
php:PHP-8.6from
DanielEScherzer:ps-migration-ext-spl
Oct 24, 2026
Merged

DanielEScherzer merged 6 commits into
php:PHP-8.6from
DanielEScherzer:ps-migration-ext-spl

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

No description provided.

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't blanket apply this change.

Comment thread ext/spl/php_spl.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment on lines 1311 to 1325
spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS));
zend_class_entry *ce = NULL;
zend_string *path;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C!", &ce) == FAILURE) {
RETURN_THROWS();
}

if (ce == NULL) {
ce = intern->info_class;
} else if (!instanceof_function(ce, spl_ce_SplFileInfo)) {
zend_argument_type_error(1, "must be a class name derived from %s or null, %s given", ZSTR_VAL(spl_ce_SplFileInfo->name), ZSTR_VAL(ce->name));
zend_argument_type_error(1, "must be a class name derived from %pS or null, %pS given", spl_ce_SplFileInfo->name, ce->name);
RETURN_THROWS();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is actually just bad. Set ce to spl_ce_SplFileInfo and then ZPP will take care of this.

Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
Comment thread ext/spl/spl_directory.c
@DanielEScherzer
DanielEScherzer changed the base branch from master to PHP-8.6 October 3, 2026 19:23
@DanielEScherzer
DanielEScherzer marked this pull request as ready for review October 24, 2026 02:42
@DanielEScherzer

Copy link
Copy Markdown
Member Author

Not going to wait for the still-queued macos tests

@DanielEScherzer
DanielEScherzer merged commit 0e63b7a into php:PHP-8.6 Oct 24, 2026
17 of 18 checks passed
@DanielEScherzer
DanielEScherzer deleted the ps-migration-ext-spl branch October 24, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants